using System.Collections.Generic;
using UnityEngine;

namespace Exploder.Demo
{
	public class PanelResetScene : UseObject
	{
		private List<GameObject> objectList;

		private void Start()
		{
			objectList = new List<GameObject>(GameObject.FindGameObjectsWithTag("Exploder"));
		}

		public override void Use()
		{
			base.Use();
			ExploderUtils.ClearLog();
			foreach (GameObject @object in objectList)
			{
				ExploderUtils.SetActiveRecursively(@object, status: true);
				ExploderUtils.SetVisible(@object, status: true);
			}
		}

		private void Update()
		{
			if (UnityEngine.Input.GetKeyDown(KeyCode.R))
			{
				Use();
			}
		}
	}
}
